package com.vvitt.kotlinhiltcarhome.binding

import android.util.Log
import android.widget.ImageView
import androidx.databinding.BindingAdapter
import coil.load
import com.vvitt.kotlinhiltcarhome.R

/**
 * @ClassName CoilViewBinding
 * @author please call me police uncel
 * @since 2023/5/25.
 * @email 110
 * @Version: V1.0.0
 * @desciption Coil加载图片，动态配置
 **/
@BindingAdapter("bindingAvator")
fun CoilViewBinding (imageView: ImageView,url: String?){
        url?.let {
            Log.d("vvitt","loading image:$url")
            imageView.load(url) {
                crossfade(true) //淡入淡出
                placeholder(R.mipmap.ic_launcher_round) //占位图
            }
        }




}